package com.wx.mall.operate.service.impl;

import com.wx.mall.operate.dto.DisClassDto;
import com.wx.mall.operate.entity.DisClass;
import com.wx.mall.operate.mapper.DisClassMapper;
import com.wx.mall.operate.service.IDisClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 优惠券分类表关联 服务实现类
 * </p>
 *
 * @author j
 * @since 2020-05-27
 */
@Service
public class DisClassServiceImpl extends ServiceImpl<DisClassMapper, DisClass> implements IDisClassService {


    @Override
    public void addOne(DisClassDto dto) {

        for (Integer classid: dto.getIds()
             ) {

            DisClass disClass=new DisClass();
            disClass.setClassId(classid);
            disClass.setDisId(dto.getDisId());
            this.save(disClass);

        }

    }
}
